Chapter 36 - Migrating State to Terraform Cloud
Move existing state files into TF Cloud
- Provision Infra using local backend Notice that you have a local state file and maybe some backups
- Destroy or don't destroy it, doesn't matter
- Add in your backend block for Terraform Cloud
- Login to Terraform Cloud
- Run
terraform init
and it will prompt you to migrate your state to the backend.
6. State file will now be on the Terraform Cloud Backend
7. Enter in your enviroment variables on the workspace
8. Run
terraform plan
and terraform apply